package com.sophialex.health.record.common.util;

import java.util.List;

import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Tree;
import org.eclipse.swt.widgets.TreeItem;

import com.sophialex.health.common.platform.exception.BusinessException;
import com.sophialex.health.record.common.Messages;
import com.sophialex.health.record.common.widget.TreeComboInit;
import com.sophialex.health.system.frame.dialog.DialogManager;

public class KsTreeInit implements TreeComboInit {

	private List list;

	public String getAllSelectText() {
		return Messages.KsTreeInit_0;
	}

	public Tree initTree(Tree tree) {
		TreeItem root = new TreeItem(tree, SWT.NONE);
		root.setText(Messages.KsTreeInit_1);
		root.setData(""); //$NON-NLS-1$
		TreeItem item;
		try {
//			list = DataSource.comService.getTkssz(SystemUtil
//					.getKsXz(SystemUtil.curKf.getFkflb()), SystemUtil.curKf
//					.getFdeptbh());
//			if (list != null && list.size() > 0) {
//				for (Tkssz tkssz : list) {
//					item = new TreeItem(root, SWT.NONE);
//					item.setText(tkssz.getFks());
//					item.setData(tkssz.getFkh());
//				}
//			}
		} catch (Exception e) {
			DialogManager.invokeWarnDlg(e.getLocalizedMessage());
		}
		root.setExpanded(true);
		return tree;
	}
}
